import React, {FC, useMemo} from "react";

interface TxtPreviewProps {
    file: any
}

const TxtPreview: FC<TxtPreviewProps> = (props) => {
    const renderTxtPreview = useMemo(() => {
        return (
            <div className="ck-editor__main" style={{padding: '10px'}}>
                <p className="ck-editor__editable ck-content" dangerouslySetInnerHTML={{__html: props.file}}></p>
            </div>
        )
    }, [props]);

    return (renderTxtPreview);
};

export default React.memo(TxtPreview);